package com.bysj.lms.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.bysj.lms.pojo.vo.RoleVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;


/**
 * <p>
 * 
 * </p>
 *
 * @author xiaojiakai
 * @since 2022-02-04
 */
@Getter
@Setter
@TableName("role")
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private String describtion;

    private String status;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    public Role(RoleVo roleVo){

        this.name = roleVo.getName();
        this.describtion = roleVo.getDescribtion();
        this.status = "0";
    }
}
